package com.qijian.production.domain;

import java.math.BigDecimal;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.qijian.common.enums.ApprovalDescriptionEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qijian.common.annotation.Excel;
import com.qijian.common.core.domain.BaseEntity;

/**
 * 生产计划单对象 sc_work_order
 *
 * @author zhangcheng
 * @date 2025-03-25
 */
@EqualsAndHashCode(callSuper = true)
@Data
@ToString
@TableName("sc_work_order")
public class ScWorkOrder extends BaseEntity{
    private static final long serialVersionUID = 1L;

    @JsonSerialize(using= ToStringSerializer.class)
    @ApiModelProperty(value = "唯一id")
    private Long id;

    @Excel(name = "订单号")
    @ApiModelProperty(value = "订单号")
    private String orderNo;

    @Excel(name = "工厂编码")
    @ApiModelProperty(value = "工厂编码")
    private String factoryCode;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "预估开产日期", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "预估开产日期")
    private Date planStartDate;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "预估完工日期", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "预估完工日期")
    private Date planEndDate;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "实际开产日期", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "实际开产日期")
    private Date actualStartDate;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "实际完工日期", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "实际完工日期")
    private Date actualEndDate;

    @Excel(name = "订单数量")
    @ApiModelProperty(value = "订单数量")
    private BigDecimal qty;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "交付日期", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "交付日期")
    private Date deliverDate;

    @Excel(name = "状态")
    @ApiModelProperty(value = "状态")
    private String status;

    @Excel(name = "工艺流转卡id")
    @JsonSerialize(using= ToStringSerializer.class)
    @ApiModelProperty(value = "工艺流转卡id")
    private Long orderCraftId;

    @Excel(name = "来源工单id")
    @JsonSerialize(using= ToStringSerializer.class)
    @ApiModelProperty(value = "来源工单id")
    private Long parentId;

    @Excel(name = "产品类型")
    @ApiModelProperty(value = "产品类型")
    private String productType;

    @Excel(name = "来源订单id")
    @JsonSerialize(using= ToStringSerializer.class)
    @ApiModelProperty(value = "来源订单id")
    private Long sourceId;

    @Excel(name = "厂区")
    @ApiModelProperty(value = "厂区")
    private String factoryArea;

    @Excel(name = "投料编码")
    @ApiModelProperty(value = "投料编码")
    private String feedNo;

    @Excel(name = "流转卡号")
    @ApiModelProperty(value = "流转卡号")
    private String circulationNo;

    @Excel(name = "流转卡是否生成")
    @ApiModelProperty(value = "流转卡是否生成")
    private String circulationStatus;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "流转卡生成时间", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "流转卡生成时间")
    private Date circulationDate;

    @Excel(name = "是否包含子工单")
    @ApiModelProperty(value = "是否包含子工单")
    private Boolean isContain;

    @Excel(name = "投料状态")
    @ApiModelProperty(value = "投料状态")
    private String feedStatus;

    @Excel(name = "投料人")
    @ApiModelProperty(value = "投料人")
    private String feedBy;

    @Excel(name = "客户id")
    @JsonSerialize(using= ToStringSerializer.class)
    @ApiModelProperty(value = "客户id")
    private Long customerId;

    @Excel(name = "客户名称")
    @ApiModelProperty(value = "客户名称")
    private String customerName;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "交货日期", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "交货日期")
    private Date deliveryDate;

    @Excel(name = "部门名称")
    @ApiModelProperty(value = "部门名称")
    private String deptName;

    @Excel(name = "订单号")
    @ApiModelProperty(value = "订单号")
    private String number;

    @Excel(name = "制单人")
    @ApiModelProperty(value = "制单人")
    private String preparedBy;

    @Excel(name = "历史工单生产量")
    @ApiModelProperty(value = "历史工单生产量")
    private BigDecimal oldQty;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "工单日期", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "工单日期")
    private Date orderTime;

    @Excel(name = "路线id")
    @JsonSerialize(using= ToStringSerializer.class)
    @ApiModelProperty(value = "路线id")
    private Long lineId;

    @Excel(name = "祖级列表")
    @ApiModelProperty(value = "祖级列表")
    private String ancestors;

    @Excel(name = "顶级任务单id")
    @JsonSerialize(using= ToStringSerializer.class)
    @ApiModelProperty(value = "顶级任务单id")
    private Long topOrderId;

    @Excel(name = "物料id")
    @JsonSerialize(using= ToStringSerializer.class)
    @ApiModelProperty(value = "物料id")
    private Long itemId;

    @Excel(name = "物料代码")
    @ApiModelProperty(value = "物料代码")
    private String itemCode;

    @Excel(name = "物料名称")
    @ApiModelProperty(value = "物料名称")
    private String itemName;

    @Excel(name = "是否已生成对应工单工序")
    @ApiModelProperty(value = "是否已生成对应工单工序")
    private Boolean isProcess;

    @Excel(name = "质检状态")
    @ApiModelProperty(value = "质检状态")
    private Boolean examineStatus;

    @Excel(name = "是否已经派工")
    @ApiModelProperty(value = "是否已经派工")
    private Boolean isDispatch;

    @Excel(name = "生产车间")
    @ApiModelProperty(value = "生产车间")
    private String workshop;

    @Excel(name = "是否领料  1、是 0、否")
    @ApiModelProperty(value = "是否领料  1、是 0、否")
    private Boolean isPicking;

    @Excel(name = "是否关闭")
    @ApiModelProperty(value = "是否关闭")
    private Boolean isClose;

    @Excel(name = "销售订单订单号")
    @ApiModelProperty(value = "销售订单订单号")
    private String contractNo;

    @Excel(name = "销售订单id")
    @JsonSerialize(using= ToStringSerializer.class)
    @ApiModelProperty(value = "销售订单id")
    private Long salesOrderId;

    @Excel(name = "销售订单详情id")
    @JsonSerialize(using= ToStringSerializer.class)
    @ApiModelProperty(value = "销售订单详情id")
    private Long salesOrderItemId;

    @Excel(name = "销售订单客户")
    @ApiModelProperty(value = "销售订单客户")
    private String custName;

    @Excel(name = "销售订单客户id")
    @JsonSerialize(using= ToStringSerializer.class)
    @ApiModelProperty(value = "销售订单客户id")
    private Long custId;

    @Excel(name = "批号")
    @ApiModelProperty(value = "批号")
    private String batchNo;

    @Excel(name = "配比")
    @ApiModelProperty(value = "配比")
    private BigDecimal proportion;

    @Excel(name = "成本对象")
    @ApiModelProperty(value = "成本对象")
    private String costObj;

    @Excel(name = "金蝶id")
    @JsonSerialize(using= ToStringSerializer.class)
    @ApiModelProperty(value = "金蝶id")
    private Long fid;

    @Excel(name = "金蝶状态")
    @ApiModelProperty(value = "金蝶状态")
    private String fStatus;

    @Excel(name = "bomid")
    @JsonSerialize(using= ToStringSerializer.class)
    @ApiModelProperty(value = "bomid")
    private Long bomId;

    @Excel(name = "bom详情id")
    @JsonSerialize(using= ToStringSerializer.class)
    @ApiModelProperty(value = "bom详情id")
    private Long mainBomDetailId;

    @Excel(name = "bom层级编号")
    @ApiModelProperty(value = "bom层级编号")
    private String detailCode;

    @Excel(name = "备注")
    @ApiModelProperty(value = "备注")
    private String remark;

    @TableField(exist = false)
    private Integer sort;
}
